package com.newgrand.controller;

import com.newgrand.domain.model.I8ReturnModel;
import com.newgrand.domain.model.Reconciliation;
import com.newgrand.service.ReconciliationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @创建人：ZhaoFengjie
 * @修改人：ZhaoFengjie
 * @创建时间：15:45 2022/10/11
 * @修改时间:：15:45 2022/10/11
 */
@Api(tags = "对账单")
@RequestMapping("/Reconciliation")
@RestController
public class ReconciliationController {

    @Resource
    private ReconciliationService reconciliationService;

    @ApiOperation(value = "对账单数据获取接口", notes = "对账单数据获取接口", produces = "application/json")
    @RequestMapping(value = "/GetDataByOrgId", method = RequestMethod.GET)
    I8ReturnModel getDataByOrgId(String orgId) {
        return reconciliationService.getDataByOrgId(orgId);
    }

    @ApiOperation(value = "对账单数据保存接口", notes = "对账单数据保持接口", produces = "application/json")
    @RequestMapping(value = "/save", method = RequestMethod.GET)
    I8ReturnModel save(Reconciliation.ReconciliationData data, String orgId) {
        return reconciliationService.save(data, orgId);
    }

    @ApiOperation(value = "对账单数据同步接口", notes = "对账单数据同步接口", produces = "application/json")
    @RequestMapping(value = "/SaveDataByOrgId", method = RequestMethod.GET)
    I8ReturnModel saveDataByOrgId(String orgId) {
        return reconciliationService.saveDataByOrgId(orgId);
    }
}
